function f=derSharePriceLogit(theta,delta,alpha,Data)

% Unpack
prods           = Data.prods;
qweightrprods   = Data.qweightrprods;
multiX1         = Data.multiX1;
% Market Shares
[sj, sij]        = LogitShareCalculation(theta,delta,Data);

% Jacobian
% remember that sij is prod x 1 x mkt x nodes

% derivative of shares wrt to delta
part1           = bsxfun(@times,sij,eye(prods));          % diagonal in multiple dimensions
sijtransp       = permute(sij,[2 1 3 4]);
part2           = multiprod(sij,sijtransp);
derShareDeltij  = part1 - part2;
derShareDelta   = sum((bsxfun(@times,derShareDeltij,qweightrprods)),4);

temp            = permute((multinv(sj)),[2 1 3]);     
PriceOverShare  = multiprod(multiX1,temp);

f               = derShareDelta*alpha;
end

